

class Student{
    public int age;
    private String name;
    int t;
    public void fun(){
        ;
    }

    public Student(int age, String name) {
        this.age = age;
        this.name = name;
    }
    public Student(){
        ;
    }
}
public class TestDemo {
    public void fun(int[]arr,int target){
        for (int i = 0; i <arr.length ; i++) {
            for (int j = i+1; j <arr.length ; j++) {
                if(arr[i]+arr[j]==target){
                    System.out.println("下标为："+i+","+j);
                }
            }
        }
    }

    public static void main(String[] args) {
        TestDemo testDemo=new TestDemo();
        Student student1=new Student();
        int[]arr=new int[]{2,7,11,15};
        testDemo.fun(arr,9);

    }
}
